﻿using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UniversalBlazor.CoreComponent
{
    public class UComponent : ComponentBase
    {
        internal PropertyStringBuilder cssClassBuilder;

        protected CSSStyleBuilder cssStyleBuilder => new CSSStyleBuilder();

        [Parameter]
        public string Style { get; set; }

        [Parameter]
        public string Class { get; set; }

        /// <summary>
        ///  将 CSS 规则拼接为字符串
        /// </summary>
        /// <param name="propertyValues">示例: "width:1px;","height:2px"</param>
        /// <returns></returns>
        protected string CSSStyle(params string[] propertyValues)
        {
            return new CSSStyleBuilder().Add(propertyValues).ToString();
        }
    }
}
